﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.ComponentModel;
using System.Collections;

namespace STLGROUP.Controls
{
    public class STLBindingSource : BindingSource
    {

        //public STLBindingSource(IContainer container);

        public void RollBack()
        {
            if (this.DataSource == null)
            {
                return;
            }

            for (int i = 0; i < this.Count; i++)
            {
                if (((DataRowView)this[i]).Row.RowState == DataRowState.Added)
                {
                    this.RemoveAt(i);
                    //i--;
                }
                //else if (((DataRowView)this[i]).Row.RowState == DataRowState.Modified)
                //{
                    
                //    //((DataRowView)this[i]).Row.RowState = DataRowState.Modified;
                //}
            }
        }

    }
}
